const source = [
  ["black", "white", "red", "blue"],
  ["128GB", "256GB", "512GB"],
  ["zhengzhou", "shenzhen", "vietnam"],
]

function combine(arrays) {
  const result = []

  const [first, ...rest] = arrays

  const restCombinations = rest.length ? combine(rest) : [[]]
  console.log(restCombinations)

  for (const item of first) {
    for (const combination of restCombinations) {
      result.push([item, ...combination])
    }
  }

  return result
}

combine(source)
// console.log(combine(source))
